home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_sarcsecret.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  117 lines

  1.  
  2. # Jones 3D Cog Script
  3. #
  4. # NUB_sarcSecret.cog
  5. #
  6. # [GGJ]
  7. #
  8. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  9. #
  10. # ========================================================================================
  11. symbols
  12.  
  13. message    activated
  14. message    startup
  15. message    arrived
  16.  
  17. thing    sarc
  18. thing    lid
  19. thing    button
  20. thing    sarcCam
  21. thing    sarcTarg
  22. thing    actorGhost
  23. thing    actor        local
  24.  
  25. surface    hole
  26.  
  27. sound    stopSnd=gen_stone_stop_c.wav        local
  28. sound    moveSnd=teo_spike_block_c.wav        local
  29.  
  30.  
  31. template    tplActor=indy_sh_actor       local
  32.  
  33. keyframe    pushButton=in_activate_medium.key        local
  34.  
  35. flex    tempRotVel    local
  36. int        curCam        local
  37. int        player        local
  38. int        moving        local
  39.  
  40. end
  41.  
  42.  
  43. # ========================================================================================
  44. code
  45. startup:
  46. player = GetLocalPlayerThing();
  47. return;
  48.  
  49. activated:
  50. if (GetSenderRef() != button) return;
  51. if (IsMoving(sarc)) return;
  52.  
  53. StartCutscene(1);
  54. curCam=GetCurrentCamera();
  55. SetAdjoinFlags(hole, 0x2);
  56.  
  57. SetCameraLookInterp(2, 0);
  58. SetCameraFocus(2, sarcCam);
  59. SetCameraSecondaryFocus(2, sarcTarg);
  60. SetCurrentCamera(2);
  61.  
  62. MakeMeStop();
  63. DeselectWeaponWait(player);
  64.  
  65. #Create an actor at the player's location and swap them out
  66. actor = CreateThing(tplActor, actorGhost);
  67. CopyPlayerHolsters(player, actor);
  68. CaptureThing(actor);
  69.  
  70. CopyPlayerHolsters(player, actor);
  71. SetThingFlags(player, 0x80000);
  72. ClearThingFlags(actor, 0x80000);
  73.  
  74. PlayKey(actor, pushButton, 4, 0x12, 0);
  75. Sleep(0.5);
  76. MoveToFrame(button, 1, 0.5);
  77. Sleep(0.5);
  78. MoveToFrame(SarcCam, 1, 0.3);
  79. MoveToFrame(Sarctarg, 1, 0.3);
  80. Sleep(1.0);
  81. moving=PlaySoundThing(moveSnd, sarc, 1.0, -1.0, -1.0, 0x81);
  82. MoveToFrame(sarc, 1 - GetCurFrame(sarc), 0.5);
  83. AttachThingToThing(lid, sarc);
  84.  
  85. tempRotVel=GetThingMaxRotVel(actor);
  86. SetThingMaxRotVel(actor, 150.0);
  87. AISetLookThing(actor, sarc);
  88.  
  89. Sleep(3.0);
  90.  
  91. CopyOrientandPos(actor, player);
  92. SetThingMaxRotVel(actor, tempRotVel);
  93. SetThingFlags(actor, 0x80000);
  94. ClearThingFlags(player, 0x80000);
  95. ClearActorFlags(player, 0x200000);
  96. DestroyThing(actor);
  97.  
  98. SetCurrentCamera(curCam);
  99.  
  100. MoveToFrame(SarcCam, 0, 5.0);
  101. MoveToFrame(Sarctarg, 0, 5.0);
  102. MoveToFrame(button, 0, 0.5);
  103.  
  104. EndCutscene();
  105. return;
  106.  
  107. arrived:
  108. if (GetSenderRef() == sarc)
  109. {
  110.     StopSound(moving, 0.0);
  111.     PlaySoundThing(stopSnd, sarc, 1.0, -1.0, -1.0, 0x0);
  112.     ClearAdjoinFlags(hole, 0x2);
  113. }
  114. return;
  115.  
  116. end
  117.